package com.dldata.devtools30.repository.zhibiao;



import com.dldata.devtools30.entity.DevtZbobjFieldEntity;
import com.dldata.devtools30.entity.DevtZbobjFieldEntity;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
import org.springframework.data.jpa.repository.Query;
import org.springframework.stereotype.Repository;

import java.util.Collection;
import java.util.List;

/**
 * Created by ai on 2017/1/11.
 */
@Repository
public interface DevtZbobjFieldEntityDao
        extends com.dldata.devtools30.repository.BaseRepository<DevtZbobjFieldEntity,String>, JpaSpecificationExecutor<DevtZbobjFieldEntity> {
    
    
    @Query("select t from DevtZbobjFieldEntity t ")
    public List<DevtZbobjFieldEntity> getAll();
    
    @Query("select t from DevtZbobjFieldEntity t where t.zbobjname like  ?1 or zbobjcode like ?1 ")
    public List<DevtZbobjFieldEntity> getAll(String serach);
    
    @Query("select t from DevtZbobjFieldEntity t where zbobjid = ?1 ")
    public List<DevtZbobjFieldEntity> getAllByZbObjId(String zbobjid);
    
    @Query("select t from DevtZbobjFieldEntity t where modelid = ?1 ")
    public List<DevtZbobjFieldEntity> getAllByModelId(String modelid);
    
    @Query("select t from DevtZbobjFieldEntity t where modelid = ?1 and zbobjid in (?2)  order by zbobjid ")
    public List<DevtZbobjFieldEntity> getAllByModelIdAndObjid(String modelid, Collection<String> zbobjidList);
    
    @Query("select t.zbobjid from DevtZbobjFieldEntity t where modelid = ?1 ")
    public List<String> getAllZbobjidByModelidId(String modelid);
    
    
}
